package message

type AlarmMessage struct {
	Typ       string `json:"type"`
	DeviceId  string `json:"deviceId"`
	ProductId string `json:"productId"`
	RuleId    int64	`json:"ruleId"`
	AlarmName string `json:"alarmName"`
	Data      interface{} `json:"data"`
}

func NewAlarmMessage(deviceId string, productId string, ruleId int64, alarmName string, data interface{}) AlarmMessage {
	return AlarmMessage{
		Typ:       string(ALARM),
		DeviceId:  deviceId,
		ProductId: productId,
		RuleId:    ruleId,
		AlarmName: alarmName,
		Data:      data,
	}
}

func (m *AlarmMessage) Type() MessageType {
	return ALARM
}
func (m *AlarmMessage) GetDeviceId() string {
	return m.DeviceId
}
func (m *AlarmMessage) GetProductId() string {
	return m.ProductId
}
